package com.eastfair.messagecenter.controller.task;

import cn.hutool.core.date.StopWatch;
import com.eastfair.annotation.annotation.tenant.TenantAuth;
import com.eastfair.core.context.ContextUtil;
import com.eastfair.messagecenter.controller.MsgController;
import core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * @ClassNameCertificateTother
 * @Description 制证对物流车
 * @Authoradmin
 * @Date 2022/12/26 14:43
 * @Version 1.0
 **/
@Component
@Slf4j
public class CertificateLogisticsSyncTask {


    @Value("${com.eastfair.projectId}")
    private Long commonProjectId;


    @Autowired
    MsgController msgController;


    /**
     * @return void
     * @Author ligang
     * @Description 定时发站内信
     * @Date 15:09 2023/1/3
     * @Param []
     **/
//    @Scheduled(cron="0/10 * * * * *")
    @XxlJob("sendInnerMsg")
    public void sendInnerMsg() {
        log.info("sendInnerMsg is execute start, projectId {}", commonProjectId);
        ContextUtil.setProjectId(commonProjectId);
        //忽略多租户
//        ContextUtil.setIsSystemOlationIgnore(true);
        msgController.executeSend();
        log.info("sendInnerMsg is execute end");

    }


}
